﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace tRIANGLES
{
    public partial class frmTriangles : Form
    {
        public frmTriangles()
        {
            InitializeComponent();
        }
        double side1, side2, hypotenuse;

        private double sumOfSquares(double value1, double value2)
        {
            value1 *= value1;
            value2 *= value2;
            return value1 + value2;
        }
        private void btnCalculate_Click(object sender, EventArgs e)
        {
            side1 = double.Parse(txtSide1.Text);
            side2 = double.Parse(txtSide2.Text);
            hypotenuse = Math.Sqrt(sumOfSquares(side1, side2));
            txtHypotenuse.Text = hypotenuse.ToString();
        }
    }
}
